package com.gt.quality.system.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * 部门表(SysDept)表实体类
 *
 * @author makejava
 * @since 2026-11-25 16:30:08
 */
@Data
@Accessors(chain = true)
@Schema(title = "SysDept", description = "EasyCode")
@TableName(value = "sys_dept", autoResultMap = true)
public class SysDept implements Serializable {

    @Serial
	private static final long serialVersionUID = 1L;

    /**
     * Description:  部门id
     */
    @TableId(value = "dept_id", type = IdType.ASSIGN_ID)
    @Schema(title = "dept_id",description = "部门id")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long deptId;

    /**
     * Description:  租户编号
     */
    @TableField(value = "tenant_id")
    @Schema(title = "tenant_id",description = "租户编号")
    private String tenantId;

    /**
     * Description:  父部门id
     */
    @TableField(value = "parent_id")
    @Schema(title = "parent_id",description = "父部门id")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long parentId;

    /**
     * Description:  祖级列表
     */
    @TableField(value = "ancestors")
    @Schema(title = "ancestors",description = "祖级列表")
    private String ancestors;

    /**
     * Description:  部门名称
     */
    @TableField(value = "dept_name")
    @Schema(title = "dept_name",description = "部门名称")
    private String deptName;

    /**
     * Description:  部门类别编码
     */
    @TableField(value = "dept_category")
    @Schema(title = "dept_category",description = "部门类别编码")
    private String deptCategory;

    /**
     * Description:  显示顺序
     */
    @TableField(value = "order_num")
    @Schema(title = "order_num",description = "显示顺序")
    private Integer orderNum;

    /**
     * Description:  负责人
     */
    @TableField(value = "leader")
    @Schema(title = "leader",description = "负责人")
    private Long leader;

    /**
     * Description:  联系电话
     */
    @TableField(value = "phone")
    @Schema(title = "phone",description = "联系电话")
    private String phone;

    /**
     * Description:  邮箱
     */
    @TableField(value = "email")
    @Schema(title = "email",description = "邮箱")
    private String email;

    /**
     * Description:  部门状态（0正常 1停用）
     */
    @TableField(value = "status")
    @Schema(title = "status",description = "部门状态（0正常 1停用）")
    private String status;

    /**
     * Description:  删除标志（0代表存在 2代表删除）
     */
    @TableField(value = "del_flag")
    @Schema(title = "del_flag",description = "删除标志（0代表存在 2代表删除）")
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * Description:  创建部门
     */
    @TableField(value = "create_dept")
    @Schema(title = "create_dept",description = "创建部门")
    private Long createDept;

    /**
     * Description:  创建者
     */
    @TableField(value = "create_by")
    @Schema(title = "create_by",description = "创建者")
    private Long createBy;

    /**
     * Description:  创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(title = "create_time",description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * Description:  更新者
     */
    @TableField(value = "update_by")
    @Schema(title = "update_by",description = "更新者")
    private Long updateBy;

    /**
     * Description:  更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(title = "update_time",description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

}


